﻿@inject IWikiService WikiService

<div style="display: flex;">
    <div style="margin:8px;width:35%;">
        <MTextarea Outlined
                   Label="搜索测试"
                   NoResize
                   Rows="20"
                   @bind-Value="_search">
        </MTextarea>
        <MButton Block OnClick="SearchAsync">搜索测试</MButton>
    </div>
    <div style="flex: 1;margin:15px;height: calc(100vh - 200px);overflow-y: auto;">
        @if (_quantity.Result.Count > 0)
        {
            <div style="font-size:15px;font-weight:bold;">测试结果：（@_quantity.ElapsedTime ms）</div>
        }
        @foreach (var item in _quantity.Result)
        {
            <MCard Style="margin:8px;"
                   Outlined>
                <MCardTitle Style="font-size:16px;font-weight:bold;">
                    <a target="_blank" style="font-weight: bold;" href="@item.FullPath">
                        @item.FileName 
                    </a>
                    <span>（语义检索：@Math.Round(item.Relevance,4)）</span>
                </MCardTitle>
                <div style="white-space: pre-line;margin:8px;">
                    @item.Content
                </div>
            </MCard>
        }
        @if (_quantity.Result.Count == 0)
        {
            <p style="font-size: 20px;text-align: center;color: darkgray;">
                暂无数据
            </p>
        }
    </div>
</div>

                        
<MOverlay Value="overlay">
    <MProgressCircular indeterminate
                       Size="64"></MProgressCircular>
</MOverlay>